﻿using Lihong.Cms.Entity;
using System;

namespace Lihong.Cms.Test
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var newsCategory = new NewsCategory();
            newsCategory.Name = "测试";
            newsCategory.ParentId = 666;
            newsCategory.DisplayOrder = 999;
            newsCategory.Id = 333;

            // 反射
            Type t = newsCategory.GetType();

            t = typeof(NewsCategory);

            //Console.WriteLine(  t.GetProperty("Id").GetValue(newsCategory));

            var properties = t.GetProperties();
            foreach (var property in properties)
            {
                var value = property.GetValue(newsCategory);

                Console.WriteLine(property.Name +"：" + value);
            }

        }
    }
}
